package com.acoreful.acf2java.admin.modules.auth.support;

/**
 * 将当前登录用户的信息放入线程上下文中
 * 
 */
public class SubjectContext {

    private static final ThreadLocal<SubjectContext> LOCAL = new ThreadLocal<SubjectContext>() {
        
        @Override
        protected SubjectContext initialValue() {
            return new SubjectContext();
        }
    };

    public static SubjectContext getContext() {
        return LOCAL.get();
    }
    
    public static void removeContext() {
        LOCAL.remove();
    }
    
    private CurrentStaff currentStaff;

    public CurrentStaff getCurrentStaff() {
        return currentStaff;
    }

    public void setCurrentStaff(CurrentStaff currentStaff) {
        this.currentStaff = currentStaff;
    }
    
}
